#include <iostream>
#include <stdio.h>
#include <algorithm>
using namespace std;
const int MAXN=1e5+7;
int a[MAXN];
int main() {
	int n;
//	freopen("in.txt", "r", stdin);
	while (~scanf("%d", &n)) {
		for (int i=0; i<n; ++i) scanf("%d", &a[i]);
		sort(a,a+n);
		int res=a[0]+a[n-1];
		for (int i=0; i<n/2; ++i) if (a[i]+a[n-i-1]<res) res=a[i]+a[n-i-1];
		printf("%d\n", res);
	}
	return 0;
}
